package com.siyuanren.gcocp.enumm;

import lombok.Getter;
import lombok.Setter;

/**
 * Created by   anxing
 * Project_name gcocp-parent
 * Path         com.siyuanren.gcocp.enumm
 * Date         2018/6/19
 * Time         9:50
 * Description
 */
@Getter
public enum CourseType {
    //课程类型(0 对话课程, 1 音频课程,2视频课程,3音视频课程)
    ChatCourse("对话课程",0),
    AudioCourse("音频课程",1),
    VideoCourse("视频课程",2),
    AudioVideoCourse("音视频课程",3);


    private String desc;
    private int value;


    CourseType(String desc, int value) {
        this.desc = desc;
        this.value = value;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public static String getDesc(Integer courseType) {
        for (CourseType type : CourseType.values()) {
            if (type.getValue() == courseType) {
                return type.getDesc();
            }
        }
        return null;
    }
}
